<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>注册</title>
	<meta author="zrong.me 曾荣">
	<link rel="stylesheet" href="/static/index/css/style.css">
    <link rel="stylesheet" type="text/css" href="/static/index/zhihu/style/register-login.css">
</head>
<body>
<canvas></canvas>
<script src="/static/index/js/index_bround.js"></script>
<div></div>
<div class="cent-box register-box">
	<div class="cont-main clearfix">
		<div class="index-tab">
			<div class="index-slide-nav">
				<a href="login.html">登录</a>
				<a href="register.html" class="active">注册</a>
				<div class="slide-bar slide-bar1"></div>				
			</div>
		</div>

		<div class="login form">
			<div class="group">
				<div class="group-ipt email">
					<input type="email" name="email" id="email" class="ipt" placeholder="手机号" required>
				</div>
				<div class="group-ipt user">
					<input type="text" name="user" id="user" class="ipt" placeholder="选择一个用户名" required>
				</div>
				<div class="group-ipt password">
					<input type="password" name="password" id="password" class="ipt" placeholder="设置登录密码" required>
				</div>
				<div class="group-ipt password1">
					<input type="password" name="password1" id="password1" class="ipt" placeholder="重复密码" required>
				</div>
				<div class="group-ipt verify">
					<input type="text" name="verify" id="verify" class="ipt" placeholder="输入验证码" required>
					<img src="{{ url_for('.verifyCode') }}?id=00000" class="imgcode">
				</div>
			</div>
		</div>

		<div class="button">
			<button type="submit" class="login-btn register-btn" id="button">注册</button>
		</div>
	</div>
</div>

<script src='/static/index/zhihu/js/particles.js' type="text/javascript"></script>
<script src='/static/index/zhihu/js/jquery.min.js' type="text/javascript"></script>
<script src='/static/index/zhihu/js/layer/layer.js' type="text/javascript"></script>
<script src='/static/index/zhihu/js/index.js' type="text/javascript"></script>
<script>
	$('.imgcode').hover(function(){
		layer.tips("看不清？点击更换", '.verify', {
        		time: 6000,
        		tips: [2, "#3c3c3c"]
    		})
	},function(){
		layer.closeAll('tips');
	}).click(function(){
		$(this).attr('src','{{ url_for(".verifyCode") }}?id=' + Math.random());
	})

	$(".login-btn").click(function(){
	    console.log(0)
	    var user = $("#user").val();
	    console.log(1);
		var email = $("#email").val();
		console.log(2);
		var password = $("#password").val();
		console.log(3);
		var verify = $("#verify").val();
		console.log(4);
		$.ajax({
		url: '/reg',
		type: 'post',
		jsonp: 'jsonpcallback', jsonpCallback: "flightHandler", async: false,
		data: {
			'name':user,
            "mobile":email,
		'password':password,
		'verify':verify
		},
		success: function(data){
            if (data.errno == 0){
                info = data.status;
                layer.msg(info);
                {#alert(data)#}
                location.href = "/login"
            }else{
                alert(data.errmsg)
            }
		}
		})

	})
	$("#remember-me").click(function(){
		var n = document.getElementById("remember-me").checked;
		if(n){
			$(".zt").show();
		}else{
			$(".zt").hide();
		}
	})
</script>
</body>
</html>